<template>
	<uni-popup ref="pop_send">
		<view class="send">
			<view class="black_1">
				<view class="title">转赠</view>
				<image @click="close()" class="img" src="../../static/my/close.png"></image>
			</view>
			<view class="black_2">
				好友ID
			</view>
			<uni-easyinput
			class="inputs"
			type="text" 
			v-model="ids" 
			:inputBorder="false" 
			:styles="{backgroundColor: '#FFE6D5'}"
			placeholder="请输入好友ID"
			placeholder-style="color:#FE903D;font-size:16px"
			></uni-easyinput>
			
			<view class="black_2 black_3">
				转赠数量
			</view>
			<uni-easyinput
			class="inputs"
			type="number" 
			v-model="num" 
			:inputBorder="false" 
			:styles="{backgroundColor: '#FFE6D5'}"
			:placeholder="placeholder"
			placeholder-style="color:#FE903D;font-size:16px"
			></uni-easyinput>
			
			
			<uni-easyinput
			class="inputs inputs2"
			type="password" 
			v-model="password" 
			:inputBorder="false" 
			:styles="{backgroundColor: 'transparent'}"
			placeholder="请输入支付密码"
			placeholder-style="color:#FE903D;font-size:16px"
			></uni-easyinput>
			
			<view class="black_4" v-if="account_type == 'usdt'">
				扣取转赠手续费<text class="text1">5%</text>
			</view>
			
			<view class="black_5" >
				<view class="text1" @click="submit()">确认</view>
			</view>
		</view>
	</uni-popup>
		
</template>

<script>
	export default {
		props:{
			success:{
				type:Function,
			}
		},
		name:"Send",
		data() {
			return {
				ids:'',
				num:'',
				password:'',
				account_type:'',
				placeholder:'请输入数量'
			};
		},
		methods:{
			open(account_type,placeholder){
			
				this.placeholder = '请输入'+placeholder+'的倍数数量'
				console.log(placeholder)
				this.account_type= account_type
				this.$refs.pop_send.open()
			},close(){
				this.$refs.pop_send.close()
			
			},
			getNum(){
				
			},
			submit(){
				if(!this.ids){
					uni.showToast({
						title: "请输入手机号或用户ID",
						icon: "none"
					})
					return
				}
				if(!this.num){
					uni.showToast({
						title: "请输入数量",
						icon: "none"
					})
					return
				}
				var data={
					account_type:this.account_type,
					account_id:this.ids,
					num:this.num,
					pay_password:this.password
				}
				this.api.http.requests('accountlog/transfer', data, res => {
					// console.log(res)
					uni.showToast({
						title: res.msg,
						icon: "none"
					})
					this.success()
					this.close()
				
				}, "POST")
			}
		}
	}
</script>

<style scoped lang="less">
	
.send{
	background: linear-gradient(180deg, #FFE6D5 0%, #FFFFFF 100%);
	border-radius: 12px 12px 12px 12px;
	border-radius: 5px;
	padding: 20px;
	width: 600upx;
	// width: 100%;
	height: auto;
}
.black_1{
	text-align: center;
	font-size: 27px;
	font-weight: 800;
	color: #333333;
	width: 100%;
	.img{
		width: 25px;
		height: 25px;
		position: absolute;
		right: 10px;
		top: 10px;
	}
}
.black_2{
	margin-top: 20px;
	font-size: 18px;
	font-weight: 800;
	color: #333333;
}

.inputs{
		margin-top: 10px;
		padding: 5px 0px;
		border: 1px solid #FFE6D5;
		border-radius: 5px;
		font-size: 30rpx;
		font-weight: 400;
		background-color: #FFE6D5;
		// text-align: end;
	}
	.inputs2{
		margin:40px auto 10px auto;
		width: 250px;
		border-radius: 20px;
		text-align: center;
	}
	.black_4{
		text-align: center;
		font-size: 14px;
		font-weight: 400;
		color: #969696;
		.text1{
			margin-left: 5px;
			color: #FE903D;
		}
	}
	
	.black_5{
		margin: 40px auto 10px auto;
		width: 146px;
		height: 45px;
		line-height: 45px;
		color: white;
		text-align: center;
		background: #FE903D;
		border-radius: 10px 10px 10px 10px;
	}
</style>